// @ts-ignore
/* eslint-disable */
import request from "@/api/http.js";

/** 此处后端没有提供注释 GET /articles */
export async function getArticleList(options?: { [key: string]: any }) {
  return request<API.BaseResponseListArticlesQueryRequest>("/articles", {
    method: "GET",
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /articles/${param0} */
export async function getArticleDetails(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getArticleDetailsParams,
  options?: { [key: string]: any }
) {
  const { articlesId: param0, ...queryParams } = params;
  return request<API.BaseResponseArticlesVO>(`/articles/${param0}`, {
    method: "GET",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /articles/${param0}/${param1} */
export async function getArticleDetailsByCategory(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getArticleDetailsByCategoryParams,
  options?: { [key: string]: any }
) {
  const { category: param0, articlesId: param1, ...queryParams } = params;
  return request<API.BaseResponseArticlesVO>(`/articles/${param0}/${param1}`, {
    method: "GET",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /articles/${param0}/list */
export async function getArticleListByCategory(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getArticleListByCategoryParams,
  options?: { [key: string]: any }
) {
  const { categoryName: param0, ...queryParams } = params;
  return request<API.BaseResponseListArticlesQueryRequest>(
    `/articles/${param0}/list`,
    {
      method: "GET",
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 此处后端没有提供注释 POST /articles/add */
export async function addArticle(
  body: API.ArticlesAddRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong>("/articles/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
